Image processing apparatus, image processing method, and non-transitory computer readable medium

ABSTRACT

An image processing apparatus includes an extraction unit and a calculation unit. The extraction unit extracts a local color displacement that is a local displacement of color in a region of interest in a given image. The calculation unit calculates a similarity between the local color displacement and an extracted-color displacement that is a displacement of a preset color.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is based on and claims priority under 35 USC 119 fromJapanese Patent Application No. 2012-176246 filed Aug. 8, 2012.

BACKGROUND

(i) Technical Field

The present invention relates to an image processing apparatus, an imageprocessing method, and a non-transitory computer readable medium.

(ii) Related Art

In recent years, technologies have been developed and utilized foroutputting an image having electronic information added thereto in amanner unrecognizable to the human eye and detecting the presence of theadded information or extracting the added information when reading theimage by using a reader.

SUMMARY

According to an aspect of the invention, there is provided an imageprocessing apparatus including an extraction unit and a calculationunit. The extraction unit extracts a local color displacement that is alocal displacement of color in a region of interest in a given image.The calculation unit calculates a similarity between the local colordisplacement and an extracted-color displacement that is a displacementof a preset color.

BRIEF DESCRIPTION OF THE DRAWINGS

Exemplary embodiments of the present invention will be described indetail based on the following figures, wherein:

FIG. 1 illustrates a first exemplary embodiment of the presentinvention;

FIGS. 2A to 2C illustrate an example of the embedding of information;

FIG. 3 illustrates a change in color when information is embedded;

FIG. 4 is a flowchart illustrating an example of an operation accordingto the first exemplary embodiment of the present invention;

FIG. 5 is a block diagram illustrating a first exemplary modification ofthe first exemplary embodiment of the present invention;

FIG. 6 is a block diagram illustrating a second exemplary modificationof the first exemplary embodiment of the present invention;

FIG. 7 is a flowchart illustrating an example of an operation accordingto the second exemplary modification of the first exemplary embodimentof the present invention;

FIG. 8 is a block diagram illustrating a second exemplary embodiment ofthe present invention;

FIG. 9 illustrates an example of the relationship between local colordisplacement and each of extracted-color displacement andnon-extracted-color displacement;

FIG. 10 is a flowchart illustrating an example of an operation accordingto the second exemplary embodiment of the present invention;

FIG. 11 is a block diagram illustrating a first exemplary modificationof the second exemplary embodiment of the present invention;

FIG. 12 is a block diagram illustrating a second exemplary modificationof the second exemplary embodiment of the present invention;

FIG. 13 is a flowchart illustrating an example of an operation accordingto the second exemplary modification of the second exemplary embodimentof the present invention;

FIG. 14 is a block diagram illustrating a third exemplary modificationof the second exemplary embodiment of the present invention;

FIG. 15 is a flowchart illustrating an example of an operation accordingto the third exemplary modification of the second exemplary embodimentof the present invention; and

FIG. 16 illustrates an example of a computer program, an example of astorage medium storing the computer program, and an example of acomputer when functions described in the exemplary embodiments of thepresent invention and the exemplary modifications thereof areimplemented by the computer program.

DETAILED DESCRIPTION

First, an image having information embedded therein, which is used inexemplary embodiments of the present invention, will be described. FIGS.2A to 2C illustrate an example of the embedding of information, and FIG.3 illustrates a change in color when information is embedded. FIG. 2Aillustrates an example of an original image, and FIG. 2B illustrates anexample of an image of information to be embedded. In the example of theoriginal image illustrated in FIG. 2A, different colors are representedby different hatching patterns. The original image is not limited to anyparticular image. Further, information may be embedded into the originalimage by embedding dots of a predetermined color. In the image of theinformation to be embedded illustrated in FIG. 2B, dots of apredetermined color are represented as black dots. The pattern to beused for embedding is not limited to a dot pattern, and the size, shape,and location of the pattern may be determined in advance and are notlimited to those in the illustrated example. The pattern with whichinformation is embedded, including the color thereof, may be set so asto be unrecognizable to most people at their first glance.

Information may be embedded into the original image by combining theinformation and the original image. For example, the image of theinformation illustrated in FIG. 2B may be combined with the imageillustrated in FIG. 2A to obtain an image illustrated in FIG. 2C. Theimage illustrated in FIG. 2C is output. Thus, an image havinginformation embedded therein is output.

FIG. 3 illustrates a specific example of a change in the color of apixel in which information is embedded. A color a is the color of thecorresponding pixel in the original image, and a color b is a color tobe embedded. The color a of the pixel is changed to a color c byembedding information into the original image. Such a pixel whose colorhas been changed may be included in a combined image. Setting the color,size, and the like to be embedded so that they are not visuallyrecognizable in the manner described above allows the visible color ofthe original image to be retained unchanged.

The color displacement in the pixel will now be focused on. The color ais changed to the color c by a displacement d. The displacement d is adisplacement of the embedded color b from white. Thus, if the color withwhich information has been embedded is given as a displacement and aregion of the color a includes a pixel of the color c, a displacementbetween the color a and the color c may be compared with the givendisplacement to determine whether or not the pixel is a pixel in whichinformation has been embedded.

The following exemplary embodiments of the present invention are basedon the findings described above. Any image may be given. If an imagehaving information embedded therein, such as the image illustrated inFIG. 2C, is given, it is detected that the image has informationembedded therein, or a process for acquiring the embedded information isperformed.

FIG. 1 is a block diagram illustrating a first exemplary embodiment ofthe present invention. A local color displacement extraction unit 1extracts a local color displacement. The local color displacement is alocal color displacement occurring in a region of interest in a givenimage. The region of interest includes one or plural pixels. The givenimage is processed while changing the region of interest over the wholeor part of the given image. The local color displacement may be obtainedby, for example, calculating a color displacement from a local averagecolor in the region of interest. The local average color may be obtainedby calculating an average of colors of all or some pixels in a region(local region) with a predetermined size and shape including the regionof interest. Further, a color displacement may also be determined as acolor difference vector. The color difference vector may be determinedusing a color vector in the region of interest in the color space and acolor vector of the local average color. Alternatively, a difference foreach component representing a color may be determined, and a vectorwhose elements are the respective differences may be used as a colordifference vector. Alternatively, local derivative values may bedetermined from color values of the image, or a local derivative valuemay be determined for each color component, and the local colordisplacement may be determined using such derivative values.

A similarity calculation unit 2 calculates a similarity between thelocal color displacement extracted by the local color displacementextraction unit 1 and an extracted-color displacement. Theextracted-color displacement is a displacement of a preset color. Inthis example, the extracted-color displacement may be a vector of acolor with which given information has been embedded or a vectordetermined from the local derivative values of the color. As an exampleof the similarity to be calculated, when the extracted-colordisplacement is represented by a vector V_(y), the local colordisplacement is represented by a vector V, and the angle defined by thevectors V_(y) and V is represented by α, a similarity F_(y) may bedetermined by

F _(y) =|V| ^(m)(cos(α))^(n),

where m and n are constants. The smaller the angle defined between thevectors V, and V, the larger the value the similarity F_(y) takes.Theoretically, if information has been embedded, the local colordisplacement will be the extracted-color displacement. Thus, the largerthe value the similarity F_(y) has, the more probable it is thatinformation may be embedded in the region of interest.

The above-described similarity calculation method is merely an example,and any other method may be used to determine a similarity.Alternatively, when a similarity is determined, the similarity in anopposite direction between the vector of the extracted-colordisplacement and the vector of the local color displacement may also bedetermined, and one of the similarities in both directions may beselected in order to deal with the case where information is embeddedwith inversion (or subtraction) when embedded.

FIG. 4 is a flowchart illustrating an example of an operation accordingto the first exemplary embodiment of the present invention. In S11, thelocal color displacement extraction unit 1 determines a local colordisplacement from a local color displacement of a in a region ofinterest, such as a color difference vector between a local averagevalue and a color in the region of interest or a local derivative value.

In S12, the similarity calculation unit 2 calculates a similaritybetween the local color displacement determined by the local colordisplacement extraction unit 1 and a preset extracted-colordisplacement.

The similarity calculated by the similarity calculation unit 2 is outputas a value of the region of interest. If a region of interest exists forwhich the similarity calculated by the similarity calculation unit 2 isgreater than or equal to a preset threshold, it may be determined thatthe given image includes embedded information. Alternatively, asimilarity image in which a value of similarity is assigned to eachregion of interest may be generated. In the similarity image, a largervalue of similarity is assigned to a region where information isembedded and, for example, as in the image illustrated in FIG. 2B, theimage of the information to be embedded is reproduced. Once the positionor shape of a portion of the image where a locally maximum value isobtained is specified, the position at which the information has beenembedded may be determined, leading to the acquisition of theinformation.

Accordingly, the presence or absence of information may be determinedand the information may be acquired using a similarity. Thus,information embedded in a portion other than a white margin may also bedetected and acquired. Furthermore, if variations in color have occurreddue to various factors, the use of a value of similarity may ensure thatinformation is detected and acquired.

FIG. 5 is a block diagram illustrating a first exemplary modification ofthe first exemplary embodiment of the present invention. In the firstexemplary modification, a binarization unit 3 is provided in addition tothe configuration illustrated in FIG. 1.

The binarization unit 3 binarizes a region of interest on the basis ofthe similarity calculated by the similarity calculation unit 2. Thebinarization unit 3 may binarize a region of interest by comparing thesimilarity calculated by the similarity calculation unit 2 with a presetthreshold. A region whose value of similarity is greater than or equalto the threshold may appear in a binary image. Alternatively, thebinarization unit 3 may perform enhancement processing on a given imagebased on a similarity, and may binarize the image subjected to theenhancement processing. For example, the larger the value the similarityhas, the greater the effect the enhancement has. Thus, a region whereinformation is embedded may be enhanced, and the enhanced portion issubjected to binarization processing and is developed in a binary image.

As described above, the degree to which information is embedded may bedetermined using a similarity image generated based on a value ofsimilarity output from the similarity calculation unit 2. With the useof a binary image, moreover, a region where information is embedded maybe explicitly identified.

FIG. 6 is a block diagram illustrating a second exemplary modificationof the first exemplary embodiment of the present invention. In thesecond exemplary modification, a vector of a color with which giveninformation has been embedded or a vector determined from a localderivative value of the color is corrected, and the corrected vector isused as an extracted-color displacement.

An extracted-color displacement setting unit 4 sets an extracted-colordisplacement from the direction of a local color displacement obtainedfrom each region of interest and from the direction of a displacement ofa given color. For example, local color displacements whose displacementdirections are within a predetermined angular range with respect to thedisplacement of the given color may be selected from among the localcolor displacements obtained from the regions of interest, and anaverage value, a center value, a local maximum value, or the like may bedetermined as an estimated color displacement. The estimated colordisplacement may be set as an extracted-color displacement. In thiscase, the direction of the displacement of the given color may becorrected to the direction of the estimated color displacement, whilethe length may not necessarily be corrected.

An extracted-color displacement may also be set by determining afrequency distribution of the directions of the local colordisplacements obtained from the individual regions of interest anddetermining a direction indicating one of the local maximum values offrequency in the frequency distribution which is the closest to thedirection of the displacement of the given color. The direction of thedisplacement of the given color may be corrected to the determineddirection, and an extracted-color displacement may be set. The settingmethods described above are merely illustrative, and an extracted-colordisplacement may be set using any other method.

The similarity calculation unit 2 may calculate a similarity using theextracted-color displacement set by the extracted-color displacementsetting unit 4 based on a displacement of a given color. Theextracted-color displacement has been corrected by the extracted-colordisplacement setting unit 4 in accordance with the given image. Thus,even if variations in color have occurred due to various factors, thesimilarity of a region where information is embedded may be larger thanthat obtained when the displacement of the given color is used as anextracted-color displacement without correction. This may ensure thatinformation is more reliably detected and acquired.

The binarization unit 3 described in the first exemplary modificationmay be added to the configuration according to the second exemplarymodification.

FIG. 7 is a flowchart illustrating an example of an operation accordingto the second exemplary modification of the first exemplary embodimentof the present invention. In the illustrated example, an extracted-colordisplacement is set using a local maximum value in a frequency ofdirections of local color displacements. The processing of S11 and S12is similar to that described above with reference to FIG. 4.

After the local color displacement extraction unit 1 determines a localcolor displacement in a region of interest in S11, then, in S21, theextracted-color displacement setting unit 4 determines a frequencydistribution of directions of local color displacements from local colordisplacements in individual regions of interest determined in S11. InS22, the extracted-color displacement setting unit 4 sets a displacementof a given color as the initial extracted-color displacement.

In S23, the extracted-color displacement setting unit 4 determines adirection whose frequency exhibits a local maximum value from thefrequency distribution determined in S21. The number of local maximumvalues is not always one, and plural local maximum values may begenerated. When plural local maximum values are generated, thedirections corresponding to the respective local maximum values aredetermined as candidates for correction. Among them, the correctioncandidate that is the closest to the direction of the displacement ofthe given color is selected.

In S24, it is determined whether or not the candidate for correctionselected in S23 satisfies a certain condition. For example, one suchcondition may be that the direction of the candidate for correction iswithin a predetermined angular range from the direction of thedisplacement of the given color, and it may be determined whether or notthis condition is satisfied. Note that conditions other than thecondition described in this example may be used.

If it is determined in S24 that the condition is satisfied, then, inS25, the local color displacement extraction unit 1 corrects the setdirection of the extracted-color displacement to the direction of thecorrection candidate selected in S23, and sets the corrected directionas an extracted-color displacement. If it is determined in S24 that thecondition is not satisfied, the local color displacement extraction unit1 does not correct the extracted-color displacement. In this case, theextracted-color displacement set in S22 is used as it is.

Using the extracted-color displacement set in the manner describedabove, the similarity calculation unit 2 may calculate a similaritybetween the local color displacement obtained by the local colordisplacement extraction unit 1 in S12 and the extracted-colordisplacement set by the extracted-color displacement setting unit 4.

If an extracted-color displacement is set using any other method,processing corresponding to the method used is performed.

FIG. 8 is a block diagram illustrating a second exemplary embodiment ofthe present invention. In the second exemplary embodiment, thesimilarity calculation unit 2 calculates a similarity using anextracted-color displacement and a non-extracted-color displacement, byway of example. In contrast to an extracted-color displacement that isbased on a color to be extracted with which information has beenembedded, a non-extracted-color displacement is based on a color not tobe extracted. For example, a vector of a color not to be extracted, avector determined from a local derivative value of the color, or thelike may be used as a non-extracted-color displacement. A region whosesimilarity to the extracted-color displacement is larger than any otherregion may not necessarily be a region where information is embedded.Thus, a non-extracted-color displacement set so that similarity based ona non-extracted-color displacement is reduced, compared to the casewhere information is not embedded in a region whose similarity base onthe extracted-color displacement is large, is used. If anindistinguishable color is used as a color with which information isembedded, the color of dust, paper powder, and other imperceptibledebris might be undesirably extracted as a color of embeddedinformation. Such inconvenience may be addressed by setting anon-extracted-color displacement. To that end, a non-extracted-colordisplacement may be a color displacement similar to an extracted-colordisplacement but different from the extracted-color displacement by apredetermined range or more distant in the color space.

As in the first exemplary embodiment, a local color displacementextraction unit 1 extracts a local color displacement in a region ofinterest in a given image.

A similarity calculation unit 2 calculates a similarity between thelocal color displacement extracted by the local color displacementextraction unit 1 and a preset extracted-color displacement, and alsocalculates a similarity between the local color displacement and anon-extracted-color displacement that is a displacement of a color setin advance not to be extracted. The similarity calculation unit 2further calculates an overall similarity from the similarity based onthe extracted-color displacement and the similarity based on thenon-extracted-color displacement, and uses the overall similarity as thesimilarity of the region of interest. The similarity between theextracted-color displacement and the local color displacement has beendescribed in the first exemplary embodiment, and will not be describedhere.

As an example of the similarity between the non-extracted-colordisplacement and the local color displacement, when thenon-extracted-color displacement is represented by a vector V_(x), thelocal color displacement is represented by a vector V, and the angledefined by the vectors V_(x) and V is represented by β, a similarityF_(x) may be determined by

F _(x) =|V| ^(m)(cos(β))^(n),

where m and n are constants. The smaller the angle defined between thevectors V_(x) and V, the larger the value the similarity F_(x) takes.The larger the value of the similarity F_(x), the less likely theextraction is to occur.

In addition, an overall similarity F is calculated from the similarityF_(y) between the extracted-color displacement and the local colordisplacement and the similarity F_(x) between the non-extracted-colordisplacement and the local color displacement. The overall similarity Fincreases as the value of the similarity F_(y) between theextracted-color displacement and the local color displacement increases,and decreases as the value of the similarity F_(x) between thenon-extracted-color displacement and the local color displacementincreases. As an example, the overall similarity F may be determined bysubtracting the similarity F_(x) from the similarity F_(y) using

F=s·F _(y) −t·F _(x),

where s and t are constants. Alternatively, the overall similarity F maybe determined by dividing the similarity F_(y) by the similarity F_(x)using

F=F _(y) /F _(x).

In addition, the overall similarity may be determined by taking thelocal color displacement into account. For example, the overallsimilarity may be controlled in accordance with the magnitude of thelocal color displacement. As an example, the overall similarity may becontrolled so that the value of the overall similarity increases as themagnitude of the local color displacement decreases. Alternatively, theoverall similarity may be controlled in accordance with the distance ofthe local color displacement from a straight line that overlaps thevector of the extracted-color displacement. As an example, the overallsimilarity may be controlled so that the value of the overall similarityincreases as the distance of the local color displacement decreases. Thecontrol described above may be performed so that, as long as the valueof the overall similarity increases, the similarity F_(x) may be reducedrelatively to the similarity F_(y) or the similarity F_(y) may beincreased relatively to the similarity F. Alternatively, the angle α,which is used to calculate the similarity F_(y), may be decreased or theangle β, which is used to calculate the similarity F_(x), may beincreased. In an alternative example, a value for correcting the valueof the overall similarity F in accordance with the size or distance ofthe local color displacement may be added to the overall similarity F.Any control method other than those in the examples described above maybe used.

The overall similarity determination method described above is merely anexample, and the overall similarity F may be determined using any ofvarious other functions having the similarity F_(y) and the similarityF_(x) as coefficients. In this case, an overall similarity may becalculated by taking into account various factors other than the localcolor displacement. Alternatively, as described in the first exemplaryembodiment, a similarity may be determined by determining the similarityin the opposite direction between each of the vectors of theextracted-color displacement and the non-extracted-color displacementand the vector of the local color displacement and selecting the largerone of the similarities in both directions in order to deal with thecase where information is embedded with inversion (or subtraction) whenembedded.

FIG. 9 illustrates an example of the relationship between the localcolor displacement and each of the extracted-color displacement and thenon-extracted-color displacement. In FIG. 9, the vector V of the localcolor displacement, the vector V_(y) of the extracted-colordisplacement, and the vector V_(x) of the non-extracted-colordisplacement are illustrated in a certain color space where the vectorsV, V_(y), and V_(x) start at the origin. In the example described above,the smaller the angle α defined between the vector V_(y) of theextracted-color displacement and the vector V of the local colordisplacement, the larger the value the similarity F_(y) takes. Further,the smaller the angle β defined between the vector V_(x) of thenon-extracted-color displacement and the vector V of the local colordisplacement, the larger the value the similarity F_(x) takes. The valueof the overall similarity F increases as the value of the similarityF_(y) increases, and decreases as the value of the similarity F_(x)increases. Accordingly, the extraction may be more likely to occur asthe vector V of the local color displacement approaches the vector V_(y)of the extracted-color displacement, and may be less likely to occur asthe vector V of the local color displacement approaches the vector V_(x)of the non-extracted-color displacement. Thus, a color that may causethe noise component, which is similar to the color with whichinformation has been embedded, is set as a non-extracted-colordisplacement to reduce the value of the overall similarity F of thecolor that may cause the noise component. Meanwhile, the value of theoverall similarity F of a color that has been displaced due to the colorwith which information has been embedded is larger than any other valueand may be developed.

FIG. 10 is a flowchart illustrating an example of an operation accordingto the second exemplary embodiment of the present invention. In S31, thelocal color displacement extraction unit 1 determines a local colordisplacement from a local displacement of a color in a region ofinterest, such as a color difference vector between a local averagevalue and a color in the region of interest or a local derivative value.

In S32, the similarity calculation unit 2 calculates a similaritybetween the local color displacement obtained by the local colordisplacement extraction unit 1 and a preset extracted-colordisplacement, and also calculates a similarity between the local colordisplacement and a preset non-extracted-color displacement.

In S33, the similarity calculation unit 2 further calculates an overallsimilarity from the similarity between the local color displacement andthe extracted-color displacement and the similarity between the localcolor displacement and the non-extracted-color displacement, which arecalculated in S32.

The overall similarity calculated by the similarity calculation unit 2is output as a value of the region of interest. If a region of interestexists for which the overall similarity calculated by the similaritycalculation unit 2 is greater than or equal to a preset threshold, itmay be determined that the given image includes embedded information.Alternatively, a similarity image in which a value of similarity isassigned to each region of interest may be generated. In the similarityimage, a larger value is assigned to a region where information isembedded, and, because of the setting of the non-extracted-colordisplacement, the similarity for the color displacement that may causethe noise component may be reduced. Thus, a similarity image having lessnoise than that in the configuration of the first exemplary embodimentdescribed above may be obtained, and an image of the embeddedinformation is reproduced. Once the position or shape of a portion ofthe image where a locally maximum value is obtained is specified, theposition at which the information has been embedded may be determined,leading to the acquisition of the information. In addition, informationembedded in a portion other than a white margin may also be detected andacquired. Furthermore, if variations in color have occurred due tovarious factors, the use of a value of similarity may ensure thatinformation is detected and acquired.

FIG. 11 is a block diagram illustrating a first exemplary modificationof the second exemplary embodiment of the present invention. Thebinarization unit 3 described above in the first exemplary modificationof the first exemplary embodiment is further provided. The binarizationunit 3 may also be provided in the second exemplary embodiment. Thebinarization unit 3 has been described previously, and will not bedescribed here. In a binary image, a region where information isembedded may be explicitly identified.

FIG. 12 is a block diagram illustrating a second exemplary modificationof the second exemplary embodiment of the present invention. In thesecond exemplary modification, by way of example, a non-extracted-colordisplacement, once set, is corrected and used.

A non-extracted-color displacement setting unit 5 sets anon-extracted-color displacement based on a local color displacementobtained from each region of interest and a given non-extracted-colordisplacement. For example, the non-extracted-color displacement settingunit 5 may collect the frequencies of occurrence of the local colordisplacements obtained from the individual regions of interest todetermine a frequency distribution, and set a non-extracted-colordisplacement based on a local-maxima color displacement. As an example,the local-maxima color displacement having the largest frequency amonglocal-maxima color displacements within a preset angular range from agiven non-extracted-color displacement may be selected, and anon-extracted-color displacement may be set again from the selectedlocal-maxima color displacement. Alternatively, a non-extracted-colordisplacement, once set, may be corrected to be close to the local-maximacolor displacement, and a non-extracted-color displacement may be setagain. In order to prevent the selection of a local-maxima colordisplacement based on the extracted-color displacement, local-maximacolor displacements within a preset angular range from theextracted-color displacement may not be selected.

The similarity calculation unit 2 calculates a similarity using the setextracted-color displacement, and also calculates a similarity using thenon-extracted-color displacement set by the non-extracted-colordisplacement setting unit 5. Then, the similarity calculation unit 2 maycalculate an overall similarity from the similarity calculated using theextracted-color displacement and the similarity calculated using thenon-extracted-color displacement. A non-extracted-color displacement isset in accordance with a given image. Thus, a non-extracted-colordisplacement may be set in accordance with the noise component includedin the given image, and the noise component may be removed, or at leastreduced.

The binarization unit 3 described in the first exemplary modificationmay be added to the configuration according to the second exemplarymodification.

FIG. 13 is a flowchart illustrating an example of an operation accordingto the second exemplary modification of the second exemplary embodimentof the present invention. The processing of S31, S32, and S33 is similarto that described above with reference to FIG. 10.

In S31, the local color displacement extraction unit 1 determines alocal color displacement in a region of interest. Then, in S41, thenon-extracted-color displacement setting unit 5 determines, from localcolor displacements of individual regions of interest determined in S31,a frequency distribution of the local color displacements. In S42, thenon-extracted-color displacement setting unit 5 sets a givennon-extracted-color displacement as the initial non-extracted-colordisplacement.

In S43, the non-extracted-color displacement setting unit 5 determines,from the frequency distribution determined in S41, whether or not acolor displacement for which the frequency satisfying conditions has alocal maximum value exists. Examples of the conditions may include acondition where the color displacement is within a preset angular rangefrom a given non-extracted-color displacement, and a condition where thecolor displacement is outside a preset angular range from anextracted-color displacement. Such a condition may be determined inadvance.

If it determined in S43 that the condition is satisfied, then in S44,the color displacement having the largest frequency among local-maximacolor displacements satisfying the condition is selected, and is newlyset as a non-extracted-color displacement. Alternatively, a givennon-extracted-color displacement is corrected to be close to theselected color displacement, and a non-extracted-color displacement isset again. If it is determined in S43 that the condition is notsatisfied, the non-extracted-color displacement is not corrected. Inthis case, the non-extracted-color displacement set in S42 is used as itis.

In S32, the similarity calculation unit 2 may calculate a similaritybetween the local color displacement obtained by the local colordisplacement extraction unit 1 and each of the extracted-colordisplacement and the non-extracted-color displacement set by thenon-extracted-color displacement setting unit 5, by using the presetextracted-color displacement and the non-extracted-color displacementset in the manner described above. Then, in S33, the similaritycalculation unit 2 may calculate an overall similarity.

FIG. 14 is a block diagram illustrating a third exemplary modificationof the second exemplary embodiment of the present invention. In thethird exemplary modification, the extracted-color displacement settingunit 4 described in the second exemplary modification of the firstexemplary embodiment is further provided in the configuration of thesecond exemplary modification of the second exemplary embodimentdescribed above. While the extracted-color displacement setting unit 4and the non-extracted-color displacement setting unit 5 may be simplyadded, the extracted-color displacement setting unit 4 and thenon-extracted-color displacement setting unit 5 may share a process fordetermining a frequency distribution of local color displacementsbecause this process is commonly performed. In the configurationillustrated in FIG. 14, this process is shared, by way of example.

The extracted-color displacement setting unit 4 sets a givenextracted-color displacement using a commonly determined frequencydistribution of local color displacements. Further, thenon-extracted-color displacement setting unit 5 sets anon-extracted-color displacement using the commonly determined frequencydistribution of local color displacements. Then, the similaritycalculation unit 2 calculates a similarity between the local colordisplacement and the extracted-color displacement and a similaritybetween the local color displacement and the non-extracted-colordisplacement using the extracted-color displacement set by theextracted-color displacement setting unit 4 and the non-extracted-colordisplacement set by the non-extracted-color displacement setting unit 5,and further calculates an overall similarity based on the calculatedsimilarities.

The binarization unit 3 described in the first exemplary modificationmay be added to the configuration according to the third exemplarymodification.

FIG. 15 is a flowchart illustrating an example of an operation accordingto the third exemplary modification of the second exemplary embodimentof the present invention. In the illustrated example of the operation,the processing of S22, S23, S24, and S25 described above with referenceto FIG. 7 according to the second exemplary modification of the firstexemplary embodiment is added to the example of the operationillustrated with reference to FIG. 13. The details of the processinghave been described, and an overview of the process flow will bedescribed here.

In S31, the local color displacement extraction unit 1 determines alocal color displacement in a region of interest. Then, in S41, theextracted-color displacement setting unit 4 and the non-extracted-colordisplacement setting unit 5 perform a common process to determine, fromlocal color displacements of individual regions of interest determinedin S31, a frequency distribution of the local color displacements.

In S22, the extracted-color displacement setting unit 4 sets adisplacement of a given color as the initial extracted-colordisplacement. Then, in S23, the extracted-color displacement settingunit 4 determines a direction in which the frequency takes a localmaximum value from the frequency distribution determined in S41, andselects the correction candidate that is the closest to the direction ofthe displacement of the given color as an extracted-color displacementamong the determined direction. In S24, it is determined whether or nota certain condition, such as a condition where the correction candidateselected in S23 is within a predetermined angular range from thedirection of the displacement of the given color, is satisfied. If thecondition is satisfied, then, in S25, the extracted-color displacementsetting unit 4 corrects the direction of the set extracted-colordisplacement to the direction of the correction candidate selected inS23, and sets the corrected direction as an extracted-colordisplacement. If it is determined in S24 that the condition is notsatisfied, the extracted-color displacement setting unit 4 does notcorrect the extracted-color displacement, and the extracted-colordisplacement set in S22 is used as it is.

Further, in S42, the non-extracted-color displacement setting unit 5sets a given non-extracted-color displacement as the initialnon-extracted-color displacement. Then, in S43, the non-extracted-colordisplacement setting unit 5 determines, based on the frequencydistribution determined in S41, whether or not a color displacementwhose frequency has a local maximum value and that satisfies a conditionsuch as a condition where the color displacement is within a presetangular range from the given non-extracted-color displacement exists. Ifit is determined in S43 that the condition is satisfied, then, in S44,the non-extracted-color displacement setting unit 5 selects the colordisplacement having the largest frequency among the local-maxima colordisplacements satisfying the condition, and sets a non-extracted-colordisplacement. If it is determined in S43 that the condition is notsatisfied, the non-extracted-color displacement setting unit 5 does notcorrect the non-extracted-color displacement, and thenon-extracted-color displacement set in S42 is used as it is.

In this manner, in S32, using the extracted-color displacement set inS22 or S25 and the non-extracted-color displacement set in S42 or S44,the similarity calculation unit 2 may calculate a similarity between thelocal color displacement and the extracted-color displacement and asimilarity between the local color displacement and thenon-extracted-color displacement. Then, in S33, the similaritycalculation unit 2 may further calculate an overall similarity.

The processing of S22, S23, S24, and S25 and the processing of S42, S43,and S44 may be performed in parallel or one of them may be followed bythe other. Furthermore, a condition relating to the extracted-colordisplacement, such as a condition where a color displacement that iswithin a preset angular range from an extracted-color displacement isnot selected, may be added as the condition on which the determinationis based in S43. In this case, the extracted-color displacement set inS22 or S25 may be used as the extracted-color displacement. In thiscase, the processing of S22, S23, S24, and S25 may be performed firstand then the determination of S43 may be performed.

FIG. 16 illustrates an example of a computer program, an example of astorage medium storing the computer program, and an example of acomputer when functions described in the foregoing exemplary embodimentsof the present invention and the exemplary modifications thereof areimplemented by the computer program.

All or some of the functions of the units described in the foregoingexemplary embodiments of the present invention and the exemplarymodifications thereof may be implemented by a computer-executableprogram 51. In this case, the program 51, data used with the program 51,and the like may be stored in a computer-readable storage medium. Theterm “storage medium” refers to a medium that causes a reading unit 73included in a hardware resource of a computer 52 to change its state ofenergy such as magnetic, optical, or electrical energy in accordancewith the description of a program and that transmits the description ofthe program to the reading unit 73 in the corresponding signal format.Examples of the storage medium may include a magneto-optical disk 61, anoptical disk 62 (including a compact disc (CD), a digital versatile disc(DVD), and so forth), a magnetic disk 63, and a memory 64 (including anintegrated circuit (IC) card, a memory card, a flash memory, and soforth). The storage medium is not limited to a portable one.

The program 51 is stored in the storage medium described above, and thestorage medium is set in, for example, the reading unit 73 or aninterface 75 of the computer 52 to read the program 51 by using thecomputer 52. The read program 51 is stored in an internal memory 72 or ahard disk 74 (including a magnetic disk, a silicon disk, and so forth).A central processing unit (CPU) 71 executes the program 51 to implementall or some of the functions described in the foregoing exemplaryembodiments of the present invention and the exemplary modificationsthereof. Alternatively, the program 51 may be transferred to thecomputer 52 via a communication path. The computer 52 may receive theprogram 51 through a communication unit 76 and store the program 51 inthe internal memory 72 or the hard disk 74, and the CPU 71 may executethe program 51 to implement all or some of the functions describedabove.

A variety of devices may be connected to the computer 52 via theinterface 75. For example, an image reading device may be connected viathe interface 75, and an image read by the image reading device or animage produced by performing processing on the read image may be used asan image to be processed and may be subjected to the processes describedin the foregoing exemplary embodiments of the present invention and theexemplary modifications thereof. A similarity or a similarity image thathas been subjected to the processes may be passed to another program,may be stored in the hard disk 74 or a storage medium via the interface75, or may be transferred to an external device via the communicationunit 76.

Some of or all the elements may be implemented by hardware.Alternatively, the elements may be implemented together with otherelements as a program including all or some of the functions describedin the foregoing exemplary embodiments of the present invention and theexemplary modifications thereof. When the elements are used for anyother application, the elements may be integrated into a program for theapplication.

The foregoing description of the exemplary embodiments of the presentinvention has been provided for the purposes of illustration anddescription. It is not intended to be exhaustive or to limit theinvention to the precise forms disclosed. Obviously, many modificationsand variations will be apparent to practitioners skilled in the art. Theembodiments were chosen and described in order to best explain theprinciples of the invention and its practical applications, therebyenabling others skilled in the art to understand the invention forvarious embodiments and with the various modifications as are suited tothe particular use contemplated. It is intended that the scope of theinvention be defined by the following claims and their equivalents.

What is claimed is:
 1. An image processing apparatus comprising: anextraction unit that extracts a local color displacement, the localcolor displacement being a local displacement of color in a region ofinterest in a given image; and a calculation unit that calculates asimilarity between the local color displacement and an extracted-colordisplacement, the extracted-color displacement being a displacement of apreset color.
 2. The image processing apparatus according to claim 1,further comprising: an extracted-color displacement setting unit thatsets the extracted-color displacement using a direction of a local colordisplacement obtained from each region of interest and using a directionof a displacement of a given color.
 3. The image processing apparatusaccording to claim 1, wherein the calculation unit further calculates asimilarity between the local color displacement and anon-extracted-color displacement, the non-extracted-color displacementbeing a displacement of a color set in advance not to be extracted, andcalculates an overall similarity using the similarity between the localcolor displacement and the extracted-color displacement and thesimilarity between the local color displacement and thenon-extracted-color displacement, the overall similarity being used as asimilarity of the region of interest.
 4. The image processing apparatusaccording to claim 2, wherein the calculation unit further calculates asimilarity between the local color displacement and anon-extracted-color displacement, the non-extracted-color displacementbeing a displacement of a color set in advance not to be extracted, andcalculates an overall similarity using the similarity between the localcolor displacement and the extracted-color displacement and thesimilarity between the local color displacement and thenon-extracted-color displacement, the overall similarity being used as asimilarity of the region of interest.
 5. The image processing apparatusaccording to claim 3, further comprising: a non-extracted-colordisplacement setting unit that collects frequencies of occurrence oflocal color displacements obtained from regions of interest to determinea local-maxima color displacement and that sets the non-extracted-colordisplacement based on the local-maxima color displacement.
 6. The imageprocessing apparatus according to claim 4, further comprising: anon-extracted-color displacement setting unit that collects frequenciesof occurrence of local color displacements obtained from regions ofinterest to determine a local-maxima color displacement and that setsthe non-extracted-color displacement based on the local-maxima colordisplacement.
 7. The image processing apparatus according to claim 1,further comprising: a binarization unit that binarizes the region ofinterest using the similarity between the local color displacement andthe extracted-color displacement.
 8. The image processing apparatusaccording to claim 3, further comprising: a binarization unit thatbinarizes the region of interest using the similarity between the localcolor displacement and the extracted-color displacement.
 9. The imageprocessing apparatus according to claim 4, further comprising: abinarization unit that binarizes the region of interest using thesimilarity between the local color displacement and the extracted-colordisplacement.
 10. The image processing apparatus according to claim 7,wherein the binarization unit binarizes the similarity.
 11. The imageprocessing apparatus according to claim 8, wherein the binarization unitbinarizes the similarity.
 12. The image processing apparatus accordingto claim 9, wherein the binarization unit binarizes the similarity. 13.The image processing apparatus according to claim 7, wherein thebinarization unit performs enhancement processing on the image inaccordance with the similarity, and binarizes an image subjected to theenhancement processing.
 14. The image processing apparatus according toclaim 8, wherein the binarization unit performs enhancement processingon the image in accordance with the similarity, and binarizes an imagesubjected to the enhancement processing.
 15. The image processingapparatus according to claim 9, wherein the binarization unit performsenhancement processing on the image in accordance with the similarity,and binarizes an image subjected to the enhancement processing.
 16. Theimage processing apparatus according to claim 13, wherein thebinarization unit performs enhancement processing on the image so thatthe larger the value the similarity has, the greater the effect theenhancement processing has, to enhance a region where information isembedded in the image.
 17. The image processing apparatus according toclaim 14, wherein the binarization unit performs enhancement processingon the image so that the larger the value the similarity has, thegreater the effect the enhancement processing has, to enhance a regionwhere information is embedded in the image.
 18. The image processingapparatus according to claim 15, wherein the binarization unit performsenhancement processing on the image so that the larger the value thesimilarity has, the greater the effect the enhancement processing has,to enhance a region where information is embedded in the image.
 19. Anon-transitory computer readable medium storing a program causing acomputer to execute a process for performing image processing, theprocess comprising: extracting a local color displacement, the localcolor displacement being a local displacement of color in a region ofinterest in a given image; and calculating a similarity between thelocal color displacement and an extracted-color displacement, theextracted-color displacement being a displacement of a preset color. 20.An image processing method comprising: extracting a local colordisplacement, the local color displacement being a local displacement ofcolor in a region of interest in a given image; and calculating asimilarity between the local color displacement and an extracted-colordisplacement, the extracted-color displacement being a displacement of apreset color.